package cn.btks.resultintegration.rule.controller;

import cn.btks.commonserver.result.ResultState;
import cn.btks.commonserver.result.StateInfo;
import cn.btks.resultintegration.rule.dto.export.ProjectExport;
import cn.btks.resultintegration.rule.pojo.EnvironmentSensitive;
import cn.btks.resultintegration.rule.service.ExportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * @Author lijun
 * @Date 2021/3/28 14:10
 */
@RestController
@RequestMapping("api/v1.0/resultIntegration/rule")
@Api(tags = "规则模块")
@Validated
public class ExportController {

    @Autowired
    ExportService exportService;

    @PostMapping("/export")
    @ApiOperation("导出研判报告")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "token", value = "token密匙", required = true, dataType = "string")
    })
    public ResultState findAllByCounty(@RequestBody ProjectExport projectExport, HttpServletRequest request) throws IOException {
        return exportService.export(projectExport,request);
    }
}
